package com.rightsidetech.system.dtos.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
public class AppUpdateReq implements Serializable {
    @ApiModelProperty(value = "更新用",required = true)
    private Long id;
    @ApiModelProperty(value = "app操作系统 1.android 2.ios",required = true)
    @NotNull(message = "app操作系统不能为空")
    @Range(min = 1, max = 2, message = "app操作类型不合法")
    private Byte appOs;
    @ApiModelProperty(value = "版本号",required = true)
    @NotBlank(message = "版本号不能为空")
    private String version;
    @ApiModelProperty(value = "上传地址")
    @Length(max = 255, message = "上传地址最长255位")
    @Pattern(regexp = "^$|[\\u4e00-\\u9fa5a-zA-Z0-9_!@#$%^&*?.,:;\\-/]+", message = "上传地址不能输入特殊字符")
    private String url;
    @ApiModelProperty(value = "md5")
    @Length(max = 200, message = "md5最长200位")
    @Pattern(regexp = "^[0-9a-zA-Z]+$", message = "md5不能含有特殊字符和中文")
    private String md5;
    @ApiModelProperty(value = "升级描述")
    @NotBlank(message = "升级描述不能为空")
    @Size(max = 60,message = "升级描述不可超过60个字符")
    @Pattern(regexp = "^$|[\\u4e00-\\u9fa5a-zA-Z0-9_!@#$%^&*?.,:;，。！？]+", message = "升级描述不能输入特殊字符")
    private String description;
    @ApiModelProperty(value = "1.终端门店 2.代理商",required = true)
    @NotNull(message = "系统类型不能为空")
    @Range(min = 1, max = 2, message = "app系统类型不合法")
    private Byte appType;
    @ApiModelProperty(value = "升级类型:1.可选择，2.必须升级",required = true)
    @NotNull(message = "升级类型不能为空")
    @Range(min = 1, max = 2, message = "app升级类型不合法")
    private Byte bugType;

}
